#!/bin/bash
#定义目录路径
dir=shell_scripts
#1 4 679 10  完成 || 2358未完成 部署docker，部署/删除k8s集群
source $dir/set_ssh.sh
source $dir/set_docker.sh
source $dir/set_k8s_cluster.sh
source $dir/set_dns.sh
source $dir/del_k8s_cluster.sh
source $dir/set_firewalld.sh
source $dir/set_normal.sh
source $dir/set_lamp.sh
source $dir/del_lamp.sh
end() {
message="
      (oo)\\_______
       (__)\\      )\\/\\
          ||----w |
          ||     || 
"
echo -e  "$message"
}
meun() {
meun_array=("一键配置免密登录" "一键部署docker环境" "一键部署k8s集群" "一键配置DNS解析" "一键删除k8s集群" "关闭防火墙" "一键部署LAMP环境" "一键删除LAMP环境" "初始化(换源+常用工具安装)" "退出")
meun_lenght=${#meun_array[@]}
for i in $(seq 1 $meun_lenght);do 
    echo -e "\e[32m    ${i}--${meun_array[$i-1]}\e[0m"
done
}
useage() {
echo -e "\e[33m请输入选项1-6\e[0m"
}
main() {
while true;do
meun
read  -p "请输入你要使用的功能   " choice
case $choice in 
  1)
    set_ssh
    end;;
  2)
    set_docker
    end;;
  3)
    add_k8s_cluster
    end;;
  4)
    set_dns
    end;;
  5)
    del_k8s_cluster
    end;;
  6)
    set_firewalld
    end;;
  7)
    set_lamp
    end;;
  8)
    del_lamp
    end;;
  9)
    set_normal
    end;;
  10)
    exit;;
  *)
    useage
esac
done
}
main
